'use strict';

const Controller = require('egg').Controller;

class mjtdoctor extends Controller {
  async index() {
    const data = await this.ctx.service.mjtdoctor.findAll(this.ctx);
    this.ctx.body = data;
  }
  async create() {
    const ctx = this.ctx;
    const params = ctx.request.body;
    const data = await ctx.service.mjtdoctor.create(params);
    ctx.body = data;
  }
  async destroy() {
    const ctx = this.ctx;
    const mjtdoctorId = ctx.params.id;
    const del = await ctx.service.mjtdoctor.delete(mjtdoctorId);
    ctx.body = del;
  }
  async update() {
    const ctx = this.ctx;
    const mjtdoctorId = ctx.params.id;
    const params = ctx.request.body;
    const change = await ctx.service.mjtdoctor.update(mjtdoctorId, params);
    ctx.body = change;
  }
  async show() {
    const ctx = this.ctx;
    const id = ctx.params.id;
    const mjtdoctor = await this.ctx.service.mjtdoctor.find(id);
    ctx.body = mjtdoctor;
  }
  async index0() {
    const ctx = this.ctx;
    const doctorFenlei = ctx.params.fenlei;
    console.log(doctorFenlei);
    const data = await this.ctx.service.mjtdoctor.findAll0(doctorFenlei);
    this.ctx.body = data;
  }
  async index00() {
    const ctx = this.ctx;
    const doctorFenlei = ctx.params.doctorFenlei;
    console.log(doctorFenlei);
    const data = await this.ctx.service.mjtdoctor.findAll00(doctorFenlei);
    this.ctx.body = data;
  }
  async index000() {
    const ctx = this.ctx;
    const doctorName = ctx.params.doctorName;
    console.log(doctorName);
    const data = await this.ctx.service.mjtdoctor.findAll000(doctorName);
    this.ctx.body = data;
  }
}
module.exports = mjtdoctor;
